<?php
/**
 * 蜗牛博客
 * 本文件内代码属于“蜗牛博客”项目，禁止修改再发布本程序源码，禁止去除页面底部的版权申明。所有版权保留
 * User: upliu
 * Email: 753073861@qq.com
 * QQ: 753073861
 * 程序主页：http://demo.upliu.net/snail-blog/
 */

error_reporting(E_ALL);
date_default_timezone_set('Asia/Shanghai');
session_start();

require __DIR__ . '/include/library.php';

defined('DIR_VIEWS') or define('DIR_VIEWS', __DIR__ . '/views');
defined('IS_PAGE_ADMIN') or define('IS_PAGE_ADMIN', 0);
define('IS_AJAX', isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] === 'XMLHttpRequest');
define('IS_POST', get_method() === 'POST');
define('ROOTPATH', __DIR__);

// csrf check
if (IS_POST && !csrf_token_is_valid()) {
    http_bad_request('CSRF token is invalid.');
}

require __DIR__ . '/include/model.php';

